﻿using Abp.Domain.Entities.Auditing;
using Akso.Infrastructure.Data.Annotations;
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Akso.Entities
{
    /// <summary>
    /// 出库单实体，软删除
    /// </summary>
    [Table("Outbounds")]
    public class Outbound : FullAuditedEntity<Guid>
    {
        public const int MaxVendorLength = 50;
        public const int MaxDeliveryLength = 100;
        public const int MaxInvoiceNumLength = 50;
        public const int MaxMaterialNoLength = 50;
        public const int MaxMaterialNameEnLength = 150;
        public const int MaxMaterialNameCnLength = 150;
        public const int MaxCurrencyLength = 10;
        public const int MaxSpecificationLength = 50;
        public const int MaxCIQNumberLength = 30;
        public const int MaxHPNumberLength = 50;
        public const int MaxCustomTypeLength = 30;

        public const int MaxPONumberLength = 50;
        //public const int MaxShelflifeLength = 10;

        [Required]
        [Column("Vendor")]
        [MaxLength(MaxVendorLength)] //供应商编码
        public virtual string Vendor { get; set; }
        //交付
        [MaxLength(MaxDeliveryLength)]
        public virtual string Delivery { get; set; }
        //发票号
        [MaxLength(MaxInvoiceNumLength)]
        public virtual string InvoiceNumber { get; set; }
        //物料号
        [MaxLength(MaxMaterialNoLength)]
        public virtual string MaterialNo { get; set; }

        //物料英文名
        [MaxLength(MaxMaterialNameEnLength)]
        public virtual string MaterialNameEn { get; set; }
        //物料中文名
        [MaxLength(MaxMaterialNameCnLength)]
        public virtual string MaterialNameCn { get; set; }
        //数量
        public virtual int Qty { get; set; }
        //净重
        [DecimalPrecision(18, 3)]
        public virtual Nullable<decimal> NetWeight { get; set; }
        //毛重
        [DecimalPrecision(18, 3)]
        public virtual Nullable<decimal> GrossWeight { get; set; }
        //净重价格
        public virtual decimal NetPrice { get; set; }
        //金额
        [DecimalPrecision(18, 3)]
        public virtual Nullable<decimal> Amount { get; set; }
        //货币
        [MaxLength(MaxCurrencyLength)]
        public virtual string Currency { get; set; }
        //规格
        [MaxLength(MaxSpecificationLength)]
        public virtual string Specification { get; set; }

        [MaxLength(MaxCIQNumberLength)]
        public virtual string CIQNumber { get; set; }
        [MaxLength(MaxHPNumberLength)]
        public virtual string HPNumber { get; set; }
        //客户类别
        [MaxLength(MaxCustomTypeLength)]
        public virtual string CustomType { get; set; }
        //PO单号
        [MaxLength(MaxPONumberLength)]
        public virtual string PONumber { get; set; }
        //保质期
        public virtual int Shelflife { get; set; }
    }
}
